Problem Note 44097: A note found in the PROC FORMAT PICTURE statement documentation is incorrect and might cause incorrect formatted values
There is a note regarding how to add a leading zero before a single-digit number when using a directive in the
Base SAS® 9.3 Procedures Guide under the PROC FORMAT PICTURE statement. The note incorrectly states the following:
Note: To add a leading zero before a single-digit number, insert a 0 before the
directive (for example, 0%d).
The note should read as follows:
Note: To add a leading zero before a single-digit number, insert a 0 before the
directive (for example, %0d).
The note appears under multiple directives. This documented but incorrect syntax can cause undesirable results in SAS output. For example, given a SAS date variable value of '01JAN2009'd, the following PICTURE statement produces the formatted value of 01-0JAN-020:
picture doc93_ (default=11) other='0%d-0%b-0%Y' (datatype=date);
The corrected PICTURE statement follows, producing the desired value of 01-JAN-2009:
picture doc92_ (default=11) other='%0d-%0b-%0Y' (datatype=date);
For more examples of using the PICTURE statement with date, time, and datetime formats, see SAS Note 8510: PROC FORMAT with PICTURE statement gives flexibility for DATE, TIME and DATETIME FORMATS.
Operating System and Release Information
SAS System | Base SAS | z/OS | 9.3 TS1M0 | 9.3 TS1M2 |
Z64 | 9.3 TS1M0 | 9.3 TS1M2 |
Microsoft® Windows® for x64 | 9.3 TS1M0 | 9.3 TS1M2 |
Microsoft Windows Server 2003 Datacenter Edition | 9.3 TS1M0 | 9.3 TS1M2 |
Microsoft Windows Server 2003 Enterprise Edition | 9.3 TS1M0 | 9.3 TS1M2 |
Microsoft Windows Server 2003 Standard Edition | 9.3 TS1M0 | 9.3 TS1M2 |
Microsoft Windows Server 2003 for x64 | 9.3 TS1M0 | 9.3 TS1M2 |
Microsoft Windows Server 2008 | 9.3 TS1M0 | 9.3 TS1M2 |
Microsoft Windows Server 2008 for x64 | 9.3 TS1M0 | 9.3 TS1M2 |
Microsoft Windows XP Professional | 9.3 TS1M0 | 9.3 TS1M2 |
Windows 7 Enterprise 32 bit | 9.3 TS1M0 | 9.3 TS1M2 |
Windows 7 Enterprise x64 | 9.3 TS1M0 | 9.3 TS1M2 |
Windows 7 Home Premium 32 bit | 9.3 TS1M0 | 9.3 TS1M2 |
Windows 7 Home Premium x64 | 9.3 TS1M0 | 9.3 TS1M2 |
Windows 7 Professional 32 bit | 9.3 TS1M0 | 9.3 TS1M2 |
Windows 7 Professional x64 | 9.3 TS1M0 | 9.3 TS1M2 |
Windows 7 Ultimate 32 bit | 9.3 TS1M0 | 9.3 TS1M2 |
Windows 7 Ultimate x64 | 9.3 TS1M0 | 9.3 TS1M2 |
Windows Vista | 9.3 TS1M0 | 9.3 TS1M2 |
Windows Vista for x64 | 9.3 TS1M0 | 9.3 TS1M2 |
64-bit Enabled AIX | 9.3 TS1M0 | 9.3 TS1M2 |
64-bit Enabled HP-UX | 9.3 TS1M0 | 9.3 TS1M2 |
64-bit Enabled Solaris | 9.3 TS1M0 | 9.3 TS1M2 |
HP-UX IPF | 9.3 TS1M0 | 9.3 TS1M2 |
Linux | 9.3 TS1M0 | 9.3 TS1M2 |
Linux for x64 | 9.3 TS1M0 | 9.3 TS1M2 |
Solaris for x64 | 9.3 TS1M0 | 9.3 TS1M2 |
*
For software releases that are not yet generally available, the Fixed
Release is the software release in which the problem is planned to be
fixed.
The
Base SAS® 9.3 Procedures Guide contains a note with syntax for adding leading zeros to format date, time, or datetime values. The note is incorrect. The directive should be placed before the leading zero.
Type: | Problem Note |
Priority: | high |
Date Modified: | 2011-09-30 15:54:41 |
Date Created: | 2011-08-24 18:50:18 |